﻿using MediatR;
using S.Eartag.Domain.Model;
using S.Eartag.Infrastructure.Interface;
using S.Eartag.Read.API.Application.Command.MarkedConditionCommand;

namespace S.Eartag.Read.API.Application.CommandHandlers.MarkedConditionCommandHandler
{
    public class MarkedConditionFindCommandHandler : IRequestHandler<MarkedConditionFindCommand, Mark>
    {
        private readonly IMarkRepository markRepository;

        public MarkedConditionFindCommandHandler(IMarkRepository markRepository)
        {
            this.markRepository = markRepository;
        }

        public async Task<Mark> Handle(MarkedConditionFindCommand request, CancellationToken cancellationToken)
        {
            return await markRepository.Get(request.id);
        }
    }
}
